import {defineStore} from "pinia";

//页面内容
interface AppPageContent {
    home_logo_dark?: string
    home_logo_light?: string
    // home_baner_background: string
    home_baner_logo?: string
    home_baner_background_dark?: string
    home_baner_content_1?: string
    home_baner_content_2?: string
    home_baner_content_3?: string
    home_baner_content_4?: string
    home_baner_content_5?: string
    home_baner_button2_route?:string  //免费体验按钮的路径
    home_baner_button2_hidden?: boolean
    slider_wechat_official_qrcode?:string
    slider_contact_email?:string,
    service_url?:string
    home_foot_beian_icp?:string
    home_foot_beian_gongan?:string
    mainSlider_serviceCard_show?: boolean
    website_title?: string;  //网站标题
    home_navigation: string;
}
export interface OperationCofig{
    enableMultiTask: boolean;
}
export interface Menu {
    title: string;
    value: string; //国际化key
    route: string;
    icon: string;
}
export interface APPSetting{
    page_content:AppPageContent
    operation_config:OperationCofig
    licence?:string
}

export const useAppStore = defineStore({
    id: "app",
    state: () => ({
        globalLoading: false,
        service_url:"https://work.weixin.qq.com/kfid/kfc1bf83fcf005d3715",
        appPageContent: {
            home_logo_dark: "https://oss.gptpro.ink/assets/website_logo_dark.png",
            home_logo_light: "https://oss.gptpro.ink/assets/website_logo_light.png",
            home_baner_logo: "https://oss.gptpro.ink/assets/bocui_logo.png",
            home_baner_background_dark: "https://oss.gptpro.ink/assets/home-backgroud.jpg",
            home_baner_content_1: "ComfyUI",
            home_baner_content_2: "工作流",
            home_baner_content_3: "一键生成",
            home_baner_content_4: "AI应用",
            home_baner_content_5: "最低成本实现AI商用落地",
            home_baner_button2_route:'/ai/chat',
            home_baner_button2_hidden: false,
            slider_wechat_official_qrcode:'https://wangbo0808.oss-cn-shanghai.aliyuncs.com/assets/qrcode_for_gh_ab766f8432d6_430.jpg',
            slider_contact_email:'bocuiai@gptpro.ink',
            service_url:"https://work.weixin.qq.com/kfid/kfc1bf83fcf005d3715",
            home_foot_beian_gongan: '皖公网安备34011102003517号',
            home_foot_beian_icp: '皖ICP备2024030146号',
            mainSlider_serviceCard_show: true,
            website_title: '',  //网站标题
            home_navigation:"[]"
        } as AppPageContent,
        operationConfig:{
            enableMultiTask:true
        } as OperationCofig,
        licence:''
    }),

    persist:
        [{storage: persistedState.localStorage, paths: ['globalLoading']}],

    getters: {
        isCommercial: (state) => {
            return state.licence.startsWith('sk')
        }
    },
    actions: {},
});
